
public class MyClass {
public static void main(String[] args) {
	
	
	 Integer integer=new Integer(2); //primiting --- object  --- >   boxing ..

	 String s="1212";
	 
	 Integer int2=new Integer(s); //
	 Integer integer2=123; // integer litral Integer integer2=new Integer(123) //autoboxing 
	 
	 
	 System.out.println(integer2); //we  could get here like  java.lang.Integer@1235fdf but here we are 
	     //getting 123 it means Integer class has overriden toSring() method
	 //whenever we print any object toString() mehtod invokes. 
	 
	 int x1 =integer.intValue(); //  unboxing..  
	 
	 int x2=integer; //   int x2=integer.intValue() // auto unboxing . 
	 
	 Float float1=new Float(12.10);
	 
	 
     float fl=float1.floatValue();
     //   int.XXXValue();
	 
	 String x="a";//1
	 String y="b";//2
	 String z="ab";//3
	 String p=x+y; // object will be also created in heap 
	  
	 
	 
	 System.out.println(int2);
	 System.out.println(integer);

	 
	  ///
	 
	 //--String -- primitive 
	 //primitive string 
	 //byte ----- int 
	 //int --long 
	 // double --float 
	 //float -- double.. 
	 //
	 //widening & narrowing.. 
	 
	 // 8 byte  (long ) ---- int (4 byte) ----narrowing
	 // 4 byte --- 8 byte ---- widing..
	 
	 
	 int ab=123;
	  String s13="1f";
	   
	  
	 String s12 = Integer.toString(ab,10);
	  System.out.println(s12);
	  
	   
	      //<className>.toString(**)  -- to convert primitive into string. 
	  
	 /// String to primitive
	  System.out.println("----------------------------------------------");
	   // 
	   // autoboxing and unboxing features come in java 1.5
	  
	  Integer i=new Integer(2); //new Integer(2)  /autoboxing
	     i++;  //    int temp=i.intValue();  //automatic 
	           //    i=new Integer(temp++);
	  System.out.println(i);
	  
	  
	  Integer i2=128;
	  Integer i3=128;
	  //till byte range same object ref will be returned from wrapper pool . 
	  // -128   +127
	  System.out.println(i2==i3);
	  
	  
	  
	  
	  
	  
	   
}
}
